from django.db import models
from utils.modelsMixin import ModelSetMixin
from django.contrib.auth.models import User  # auth自带的用户表
# Create your models here.

# 班级模型类
class Classes(ModelSetMixin):
    name = models.CharField(max_length=30, verbose_name='班级名')
    slogan = models.TextField(null=True,blank=True,verbose_name='班级口号')
    # 多对多关系，班级与用户，一个班有很多学生，一个学生也可以在很多班学习
    member = models.ManyToManyField(User)

    class Meta:
        db_table = 'classes'  # 设置表名
        verbose_name = '班级'
        verbose_name_plural = verbose_name